<cfquery name = "quser" datasource="#request.dsn#">
SELECT * FROM contacts_users JOIN profile_public ON contacts_users.id = profile_public.userid
WHERE contacts_users.id = <cfqueryparam value="#pid#" cfsqltype="cf_sql_integer">
</cfquery>